
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module data_model.cog_model</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="data_model.html"><font color="#ffffff">data_model</font></a>.cog_model</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/lc6/pygenome/src/data_model/cog_model.py">/home/lc6/pygenome/src/data_model/cog_model.py</a></font></td></tr></table>
    <p><tt>Cog&nbsp;Model</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="copy.html">copy</a><br>
</td><td width="25%" valign=top><a href="logging.html">logging</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="data_model.cog_model.html#CogModel">CogModel</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="CogModel">class <strong>CogModel</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Cog&nbsp;model&nbsp;store&nbsp;the&nbsp;cog&nbsp;tree&nbsp;and&nbsp;hit&nbsp;information.<br>
We&nbsp;will&nbsp;use&nbsp;the&nbsp;data&nbsp;in&nbsp;<a href="#CogModel">CogModel</a>&nbsp;to&nbsp;draw&nbsp;things.<br>
Each&nbsp;<a href="#CogModel">CogModel</a>&nbsp;represent&nbsp;a&nbsp;data&nbsp;file.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="CogModel-__init__"><strong>__init__</strong></a>(self, file_base_name, cog_map, owner<font color="#909090">=None</font>)</dt><dd><tt>One&nbsp;data&nbsp;file&nbsp;should&nbsp;have&nbsp;one&nbsp;<a href="#CogModel">CogModel</a>&nbsp;<br>
-&nbsp;`file_base_name`:&nbsp;is&nbsp;the&nbsp;file&nbsp;name&nbsp;with&nbsp;out&nbsp;path<br>
-&nbsp;`cog_map`:&nbsp;is&nbsp;the&nbsp;cog&nbsp;family&nbsp;map</tt></dd></dl>

<dl><dt><a name="CogModel-add_genome_records"><strong>add_genome_records</strong></a>(self, records)</dt><dd><tt>Add&nbsp;genome&nbsp;records&nbsp;to&nbsp;_genome_data_map<br>
according&nbsp;to&nbsp;its&nbsp;family&nbsp;name<br>
&nbsp;<br>
Arguments:<br>
-&nbsp;`records`:&nbsp;a&nbsp;list&nbsp;of&nbsp;CogRecords</tt></dd></dl>

<dl><dt><a name="CogModel-clean_data"><strong>clean_data</strong></a>(self)</dt><dd><tt>Remove&nbsp;data&nbsp;from&nbsp;cog&nbsp;map</tt></dd></dl>

<dl><dt><a name="CogModel-get_cog_range"><strong>get_cog_range</strong></a>(self, cog_name)</dt><dd><tt>This&nbsp;is&nbsp;the&nbsp;interface&nbsp;to&nbsp;draw&nbsp;cog&nbsp;range&nbsp;graphic<br>
Return:<br>
the&nbsp;length&nbsp;of&nbsp;this&nbsp;cog&nbsp;and<br>
the&nbsp;a&nbsp;list&nbsp;of&nbsp;(id,&nbsp;start,&nbsp;end)&nbsp;positions&nbsp;of&nbsp;every&nbsp;genome&nbsp;record<br>
Arguments:<br>
-&nbsp;`cog_name`:&nbsp;the&nbsp;cog&nbsp;name&nbsp;string</tt></dd></dl>

<dl><dt><a name="CogModel-get_function_category"><strong>get_function_category</strong></a>(self)</dt><dd><tt>Return&nbsp;a&nbsp;FunctionCategory&nbsp;<a href="__builtin__.html#object">object</a></tt></dd></dl>

<dl><dt><a name="CogModel-get_non_empty_cog_names"><strong>get_non_empty_cog_names</strong></a>(self)</dt><dd><tt>Return&nbsp;a&nbsp;list&nbsp;of&nbsp;(cog_name,&nbsp;file_name,&nbsp;hit_count)</tt></dd></dl>

<dl><dt><a name="CogModel-get_single_cog"><strong>get_single_cog</strong></a>(self, cog_name)</dt><dd><tt>Return&nbsp;a&nbsp;cog&nbsp;<a href="__builtin__.html#object">object</a><br>
&nbsp;<br>
Arguments:<br>
-&nbsp;`cog_name`:</tt></dd></dl>

<dl><dt><a name="CogModel-get_total_cog_names_and_hits"><strong>get_total_cog_names_and_hits</strong></a>(self)</dt><dd><tt>Return&nbsp;a&nbsp;list&nbsp;of&nbsp;[hit_count].&nbsp;The&nbsp;size&nbsp;of&nbsp;list&nbsp;is&nbsp;equal&nbsp;to<br>
the&nbsp;number&nbsp;of&nbsp;COG<br>
Note:&nbsp;a&nbsp;record&nbsp;will&nbsp;return&nbsp;even&nbsp;there's&nbsp;no&nbsp;hits&nbsp;on&nbsp;the&nbsp;cog.<br>
In&nbsp;this&nbsp;case,&nbsp;&nbsp;hit_count&nbsp;would&nbsp;be&nbsp;zero</tt></dd></dl>

<hr>
Properties defined here:<br>
<dl><dt><strong>base_name</strong></dt>
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = _get_base_name(self)</dt></dl>
</dd>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>__dict__</strong> = &lt;dictproxy object&gt;<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dl>

<dl><dt><strong>__weakref__</strong> = &lt;attribute '__weakref__' of 'CogModel' objects&gt;<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;(if&nbsp;defined)</tt></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>__author__</strong> = 'Lei Chen &lt;hide1713@gmail.com&gt;'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Lei&nbsp;Chen&nbsp;&lt;hide1713@gmail.com&gt;</td></tr></table>
</body></html>